var player;
// Callback for when the YouTube iFrame player is ready
function onYouTubeIframeAPIReady() {
	function GetQueryString(name)
    {
        var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
        var r = window.location.search.substr(1).match(reg);
        if(r!=null)return  unescape(r[2]); return null;
    }
  player = new YT.Player('player', {
    // Set Player height and width
    height: '211',
    width: '640',
    // Set the id of the video to be played
    videoId: GetQueryString("video_id"),    // Setup event handelers
    events: {
      'onReady': onPlayerReady
    }
  });
};
function onPlayerReady(){
  // Update page after player is ready
//updateAll();
//playVideo();
}
// Updates all HTML nodes
function updateAll(){
  for (var node in nodeList){
    update(nodeList[node]);
  }
};
function playVideo(){
  player.playVideo();
};
